package chap10collection.test4;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author zdl
 * @date 2024/12/17
 */
public class Demo4 {
    public static void main(String args[]){
        List list = new ArrayList();
        list.add("“Hello”");
        list.add("“Learn”");
        list.add("“Hello”");
        list.add("“Welcome”");
        Set set = new HashSet();
        set.addAll(list); // set集合[Hello,Learn,Welcome]
        System.out.println(set.size()); //3
    }
}
